 <!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>我的门店</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right"><!--右侧内容-->
					<div class="rigtop">
						<span class="title">我的门店</span>
					</div>
					<div class="indrig_con" style="position: relative;">
						<div class="zizh_btnbox" style="top: -58px;right: 20px;">
							<button class="zizh_btn" type="button" onclick="store_add()"><i class="iconfont icon-jia"></i>创建门店</button>
						</div>
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->
							<form id="my_form" action="{:url('store/store_manage')}" method="post">
							<div class="zizh_con_1">
								<div class="chax_rowbox clearfix">
									<div class="shxx_row clearfix">
						            <div class="left">门店名称：</div>
						            <div class="right clearfix">
										<input type="text" name="store_name" placeholder="输入门店名称" class="chax_input" />
						            </div>
						        </div>
							    <div class="shxx_row clearfix">
						            <div class="left">门店地址：</div>
						            <div class="right clearfix">
										<input type="text" name="addres" placeholder="输入门店地址" class="chax_input" />
						            </div>
						        </div>
						        <div class="shxx_row clearfix">
						            <button  type="submit" onclick="return check_time()" class="htcxbtn">搜索</button>
						        </div>
							</div>
							</form>
								<div class="chax_conbox">
									<div class="chax_jiegnr">
										<table class="zizh_table1">
											<thead>
												<tr>
													<th class="w_10">编号</th>
													<th class="w_30">收款二维码 | 门店名称</th>
													<th class="w_15">门店地址</th>
													<th class="w_10">收银员</th>
													<th class="w_15">注册时间</th>
													<th class="w_20">操作</th>
												</tr>
											</thead>
											<tbody id="tbody">
												{volist name="list" id="ad" empty="$empty"}
												<tr>
													<td>{$ad.id}</td>
													<td><a class="iconfont icon-erweima"  href="javascript:;" onclick="fukuan('{$ad.id}')"></a>{$ad.store_name}</td>
													<td>{$ad.addres}</td>
													<td>{$ad.count|default="0"}</td>
													<td>{$ad.add_time|substr=0,10}</td>
													<td>
													<a onclick="daying_edit('{$ad.id}')" style="margin-top: 2px;">打印机设置</a>
													<a onclick="open_edit('{$ad.id}')" style="margin-top: 2px;">编辑</a>
													<a onclick="store_del('{$ad.id}')" style="margin-top: 2px;">删除</a>
													</td>
												</tr>
												{/volist}
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		<script>
			function fukuan(store_id) {
				var url = 'fukuan?store_id='+store_id;
				layer.open({
				  type: 2,
				  title: '门店收款二维码',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['426px', '658px'],
				  content: [url]
				}); 
			}
			function daying_edit(mid){
				var url='daying_edit?mid='+mid;
				layer.open({
				  type: 2,
				  title: '门店打印机设置',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['500px', '350px'],
				  content:  [url]
				}); 
			}
			function open_edit(id){
				var url='store_edit?id='+id;
				layer.open({
				  type: 2,
				  title: '编辑门店',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['500px', '250px'],
				  content:  [url]
				}); 
			}
			function store_add() {
				layer.open({
				  type: 2,
				  title: '创建门店',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['500px', '250px'],
				  content: "{:url('store/store_add')}"
				}); 
			}
			
			function store_del(id) {
				layer.confirm('您确定要删除吗？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						url: "{:url('store/store_del')}",
						data: {
							id:id,
						},
						success: function(data) {
							layer.msg(data.msg, {
								  icon: 1,
								  time: 1500 //2秒关闭（如果不配置，默认是3秒）
								}, function(){
									//location.href = "{:url('store/store_manage')}";
								});
						}
					})
				})
			}
		</script>
	</body>

</html>
